package com.io;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * @author zhuangqi
 * @@date 2017/3/27.
 */
public class ByteIOTest {
    public static void main(String[] args) {

    }
    public static void copy(InputStream input, OutputStream output){
        byte[] buf = new byte[4096];
        int byteRead = 0;
        try {
            while ((byteRead = input.read(buf)) != -1){
                output.write(buf,0,byteRead);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
